﻿package net.chrisjrock.dataOrg
{
	/**
	 * ...
	 * @author Christopher J. Rock
	 */
	public class TaggedObject
	{
		public var value:*;
		public var tagStr:String;
		public var tagNum:Number;
		
		public function TaggedObject (value:* , tagStr:String = "" , tagNum:Number = NaN):void {
			this.value = value;
			this.tagStr = tagStr;
			this.tagNum = tagNum;
		}
		
		public function toString():String { return tagStr + "/" + tagNum + ": " + value; }
		
		public static function tagObjects (objects:Array , tagStr:String , tagNum:Number , tagNumIncrement:Number = 0):Array {
			var i0:int = objects.length - 1;
			for (; i0 >= 0 ; i0--) objects[i0] = new TaggedObject(objects[i0] , tagStr , tagNum + i0 * tagNumIncrement);
			return objects;
		}
	}
}